package day0318.homework;

import java.util.Scanner;

/**
 * @Author Stringzhua
 * @Date 2024/3/17 13:48
 * description:黑塔
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        while (T-- > 0) {
//            System.out.println("测试");
            int n = scanner.nextInt();
            //创建数组保存为n大小的怪物
            int[] h = new int[n];
            //给h数组遍历赋值
            for (int i = 0; i < n; i++) {
                h[i] = scanner.nextInt();
            }
            //记录E，R技能的伤害
            int E = scanner.nextInt();
            int R = scanner.nextInt();
            //初始化contE,contR,分别表示黑塔使用E技能和"转圈圈的次数"
            int cntE = 0, cntR = 0;
            boolean usedE = false;//定义boolean表示E技能是否已经使用了
            for (int i = 0; i < n; i++) {
                //判断敌人的血量是否大于0
                if (h[i] <= 0) continue;
                if (!usedE) {//如果已经使用了E技能
                    cntE++;
                    for (int j = 0; j < n; j++) {
                        h[j] -= E;
                    }
                    //E技能结束后,将E技能状态恢复为可用状态
                    usedE = true;
                } else {//转圈圈
                    cntR++;
                    for (int j = 0; j < n; j++) {
                        h[j] -= R;
                    }
                    usedE = false;
                }
                for (int j = 0; j < n; j++) {
                    //判断怪物的血量是否掉到了50%及其以下
                    if (h[j] < h[j] / 2) {
                        usedE = false;
                        break;
                    }
                }
            }
            System.out.println(cntE + " " + cntR);
        }
    }
}

